<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class CmsSitesAdd extends AbstractMigration
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change(): void
    {
        $table = $this->table('ctmon_cms_sites', array('id' => false, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'signed' => false, 'collation' => 'utf8mb4_general_ci', 'comment' => '站点管理||'));
        $table->addColumn('id', 'biginteger', array('limit' => 20, 'signed' => false, 'identity' => true, 'null' => false, 'comment' => '自增id'))
            ->addColumn('name', 'string', array('limit' => 20, 'null' => false, 'comment' => '语言名称'))
            ->addColumn('label', 'string', array('limit' => 20, 'null' => false, 'comment' => '显示文本'))
            ->addColumn('link', 'string', array('limit' => 20, 'null' => false, 'comment' => '站点链接'))
            ->addColumn('is_show', 'boolean', array('limit' => 1, 'default' => 1, 'null' => false, 'comment' => '是否显示'))
            ->addColumn('sort', 'integer', array('limit' => 4, 'default' => 0, 'null' => false, 'comment' => '排序'))
            ->addColumn('ver', 'biginteger', array('limit' => 20, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '在校时长'))
            ->addColumn('create_time', 'integer', array('limit' => 10, 'signed' => false, 'default' => 0, 'comment' => '创建时间'))
            ->addColumn('update_time', 'integer', array('limit' => 10, 'signed' => false, 'default' => 0, 'comment' => '修改时间'))
            ->addColumn('delete_time', 'integer', array('limit' => 10, 'signed' => false, 'default' => 0, 'comment' => '删除时间'))
            ->create();
    }
}
